Class HCC.DT.HCC2HL72.ApptStusUpd Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.EDI.XML.Document, EnsLib.HL7.Message) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.EDI.XML.Document' targetClass='EnsLib.HL7.Message' sourceDocType='PRPA_IN410002UV:PRPA_IN410002UV' targetDocType='2.5.1:SRM_S01' create='new' language='objectscript' >
<assign value='source.{id().extension}' property='target.{MSH:MessageControlID}' action='set' />
<assign value='source.{creationTime().value}' property='target.{MSH:DateTimeOfMessage.Time}' action='set' />
<assign value='"SRM"' property='target.{MSH:MessageType.MessageCode}' action='set' />
<assign value='"S01"' property='target.{MSH:MessageType.TriggerEvent}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().subject().patient().id().item().extension}' property='target.{PIDgrp(1).PID:PatientID.IDNumber}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().subject().patient().choice.patientPerson().id.item().extension}' property='target.{PIDgrp().PID:PatientIdentifierList(1).IDNumber}' action='set' />
<assign value='##class(HCC.Utils.Functions).GetDataByXPath(source.{controlActProcess().subject().encounterAppointment().subject().patient().choice.patientPerson().name()}, "//s:item/s:part/@value")' property='target.{PIDgrp().PID:PatientName(1)}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().performer().assignedPerson().id.item().extension}' property='target.{ARQ:EnteredByPerson(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().id().item().extension}' property='target.{ARQ:OccurrenceNumber}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().effectiveTime().low.value}' property='target.{ARQ:RequestedStartDateTimeRange(1).RangeStartDateTime}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().arrivedBy.transportationIntent().id.item().extension}' property='target.{RGSgrp(1).RGS:ResourceGroupID.Identifier}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().performer().time.low.value}' property='target.{RGSgrp().AIPgrp(1).AIP:StartDateTime.Time}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().arrivedBy.transportationIntent().effectiveTime.low.value}' property='target.{RGSgrp().AIGgrp(1).AIG:StartDateTime.Time}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().arrivedBy.transportationIntent().effectiveTime.high.value}' property='target.{RGSgrp().AIGgrp().AIG:Duration}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().reusableDevice().assignedDevice().id().item().extension}' property='target.{ARQ:PlacerAppointmentID}' action='set' />
<assign value='source.{controlActProcess().subject().encounterAppointment().reusableDevice().time.low.value}' property='target.{ARQ:AppointmentDuration}' action='set' />
</transform>
}

}
